package com.ruoyi.common.enums;

public enum ApproveStatus {
    WAIT_MINISTRY(0, "数据待核验"),
    WAIT(1, "待审核"),
    APPROVE(2, "审核通过"),
    REJECT(3, "审核驳回"),
    WAIT_CANCEL(4, "待注销"),
    CANCEL(5, "已注销"),
    REJECT_CANCEL(6, "注销驳回"),
    CHANGE_WAIT(8, "变更待审核"),
    CHANGE_SUCCESS(9, "变更成功"),
    CHANGE_REJECT(10, "变更驳回"),
    CHANGE_RECEIVE(11, "待接受变更申请"),
    CHANGE_RECEIVE_SUCCESS(12, "已接受变更申请"),
    CHANGE_RECEIVE_FAILURE(13, "已拒绝变更申请"),
    ;

    private final Integer code;
    private final String desc;

    ApproveStatus(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static ApproveStatus getCode(Integer code) {
        for (ApproveStatus type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}
